package com.lin.controller;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import service.UserService;
import util.ResponseVo;
@RestController
public class LoginController {
   @Reference
   private   UserService userService;
    @PostMapping("/login")
    public ResponseVo login(String username, String password){
        return userService.login(username, password);
    }

    @PostMapping("/refresh/{token}")
    public ResponseVo refresh(@PathVariable("token")String token) {
        return userService.refreshToken(token);
    }
}
